package onlinecalsys.server.database;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class MySQLDatabaseSetup {
	

	
		/** The connect. */
		private Connection connect;
		
		/** The statement. */
		private Statement statement;

		/** The Constant host. */
		private static final String host = "jdbc:mysql://localhost/onlinecalsys";
		
		/** The Constant user. */
		private static final String user = "root";
		
		/** The Constant passw. */
		private static final String passw = "";

		/**
		 * Connect.
		 * 
		 * @return the statement
		 * 
		 * @throws SQLException the SQL exception
		 */
		public Statement connect() throws SQLException {
			
				connect = DriverManager.getConnection(host, user, passw);
				statement = connect.createStatement();

				return statement;

		}

		/**
		 * Close.
		 * 
		 * Close.
		 * 
		 * @throws SQLException the SQL exception
		 */
		public void close() throws SQLException {
			
				if (statement != null) 
					statement.close();
				
				if(connect != null) 
					connect.close();
		}

		

}
